package demo4;




public class Test {
    public static void main(String[] args) {
        ID d =new ID(){
            @Override
            public void fun() {
                System.out.println("hahaha");
            }
        };
        d.fun();
    }
    public static void main4(String[] args) {
        new ID(){
            @Override
            public void fun() {
                System.out.println("hahaha");
            }
        }.fun();
    }
    public static void main3(String[] args) {
        new D(){
            @Override
            public void func() {
                System.out.println("heihei");
            }
        }.func();
    }


    public static void main2(String[] args) {
        C c = new C();
        c.fun1();
    }

    public static void main1(String[] args) {
       /* //实例内部实例化
        A a = new A();
        a.fun3();
        A.B bb = a.new B();
        bb.func();
        System.out.println("=========");
        //实例内部实例化
        A.B b = new A().new B();
        b.func();*/



    }
}
